/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package GUI.Menu;

import GUI.FrameControlThuChi.JIFListPhieuThu;
import GUI.FrameControlThuChi.jframePhieuThuTien;
import java.beans.PropertyVetoException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.ImageIcon;
import javax.swing.JDesktopPane;

/**
 *
 * @author 10520_000
 */
public class JIFThuChi extends javax.swing.JInternalFrame {

    private JDesktopPane desktop;
    /**
     * Creates new form JIFDanhMuc
     */
    public JIFThuChi() throws PropertyVetoException {
        
        this.setFrameIcon(new ImageIcon("src/Image/login.png"));
       javax.swing.plaf.InternalFrameUI gui  = this.getUI();  
            ((javax.swing.plaf.basic.BasicInternalFrameUI)gui).setNorthPane(null);
        initComponents();
        
    }
    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jScrollPane1 = new javax.swing.JScrollPane();
        jTree1 = new javax.swing.JTree();
        jPanelHeThong = new javax.swing.JPanel();
        jLabelTieuDe5 = new javax.swing.JLabel();
        jButtonDanhSachNguoiDung = new javax.swing.JButton();
        jButtonCapQuyen = new javax.swing.JButton();

        jScrollPane1.setViewportView(jTree1);

        setClosable(true);
        setIconifiable(true);
        setMaximizable(true);
        setMaximumSize(new java.awt.Dimension(80, 80));
        addComponentListener(new java.awt.event.ComponentAdapter() {
            public void componentMoved(java.awt.event.ComponentEvent evt) {
                formComponentMoved(evt);
            }
        });

        jPanelHeThong.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        jLabelTieuDe5.setBackground(new java.awt.Color(255, 153, 255));
        jLabelTieuDe5.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N
        jLabelTieuDe5.setForeground(new java.awt.Color(255, 255, 255));
        jLabelTieuDe5.setText("Quản lý thu chi");

        jButtonDanhSachNguoiDung.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image/list1.png"))); // NOI18N
        jButtonDanhSachNguoiDung.setText("Lập phiếu thu tiền");
        jButtonDanhSachNguoiDung.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        jButtonDanhSachNguoiDung.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonDanhSachNguoiDungActionPerformed(evt);
            }
        });

        jButtonCapQuyen.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image/quyen.png"))); // NOI18N
        jButtonCapQuyen.setText("Danh sách phiếu thu");
        jButtonCapQuyen.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        jButtonCapQuyen.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonCapQuyenActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanelHeThongLayout = new javax.swing.GroupLayout(jPanelHeThong);
        jPanelHeThong.setLayout(jPanelHeThongLayout);
        jPanelHeThongLayout.setHorizontalGroup(
            jPanelHeThongLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelHeThongLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanelHeThongLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabelTieuDe5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanelHeThongLayout.createSequentialGroup()
                        .addGroup(jPanelHeThongLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jButtonCapQuyen, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jButtonDanhSachNguoiDung, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 217, Short.MAX_VALUE))
                        .addContainerGap())))
        );
        jPanelHeThongLayout.setVerticalGroup(
            jPanelHeThongLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelHeThongLayout.createSequentialGroup()
                .addComponent(jLabelTieuDe5, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButtonDanhSachNguoiDung)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButtonCapQuyen, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(208, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 261, Short.MAX_VALUE)
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addContainerGap()
                    .addComponent(jPanelHeThong, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addContainerGap()))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 358, Short.MAX_VALUE)
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addContainerGap()
                    .addComponent(jPanelHeThong, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addContainerGap()))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void formComponentMoved(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_formComponentMoved
        // TODO add your handling code here:
        // TODO add your handling code here:
        if(this.getLocation().y < 0){
            this.setLocation(this.getLocation().x, 0);
        }
        
        if(this.getLocation().x < 0){
            this.setLocation(0, this.getLocation().y);
        }
        
    }//GEN-LAST:event_formComponentMoved

    private void jButtonDanhSachNguoiDungActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonDanhSachNguoiDungActionPerformed
        // TODO add your handling code here:
        new jframePhieuThuTien(null).setVisible(true);
                
        
    }//GEN-LAST:event_jButtonDanhSachNguoiDungActionPerformed

    private void jButtonCapQuyenActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonCapQuyenActionPerformed
        // TODO add your handling code here:
        if(desktop.getComponentCount() != 0)
            desktop.getComponent(0).setVisible(false);
        desktop.removeAll();
        JIFListPhieuThu frame;
        try {
            frame = new JIFListPhieuThu();
            frame.setVisible(true);
            getDesktop().add(frame);
            frame.setSelected(true);
        } catch (PropertyVetoException ex) {
            Logger.getLogger(JIFDanhMuc.class.getName()).log(Level.SEVERE, null, ex);
        }
        
    }//GEN-LAST:event_jButtonCapQuyenActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButtonCapQuyen;
    private javax.swing.JButton jButtonDanhSachNguoiDung;
    private javax.swing.JLabel jLabelTieuDe5;
    private javax.swing.JPanel jPanelHeThong;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTree jTree1;
    // End of variables declaration//GEN-END:variables

    /**
     * @return the desktop
     */
    public JDesktopPane getDesktop() {
        return desktop;
    }

    /**
     * @param desktop the desktop to set
     */
    public void setDesktop(JDesktopPane desktop) {
        this.desktop = desktop;
    }
}
